<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自动计算器</title>

</head>

<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="Application">
        <h1>computed实现自动计算器</h1>
        <input type="text" v-model="one">
        <input type="text" v-model="two">
        结果是：{{result}}

    </div>

    <script>
        const App = Vue.createApp({
            setup() {

                const one = Vue.ref('')
                const two = Vue.ref('')
                const result = Vue.computed(() => {
                    return Number(one.value) + Number(two.value);

                })

                return {
                    one, two, result
                }

            }
        })
        App.mount("#Application")
    </script>

</body>

</html>